package lily.phs.object.test;

import lily.phs.database.Constants;
import lily.phs.healthedu.Healthedu;
import lily.phs.object.HealthEdu;
import android.database.Cursor;
import android.test.AndroidTestCase;

public class TextHealthEduView extends AndroidTestCase implements Constants{
	public void textHealthEdu(){
		HealthEdu he = new HealthEdu(getContext());
		he.set_Id(123456);
		he.setHere_time("2011-10-20");
		he.setHere_place("兰州");
		he.setHere_form("医术比赛");
		he.setHere_theme("济世救人");
		he.setHere_organizer("兰州大学");
		he.setHere_sort("不清楚");
		he.setHere_acc_num(365);//自己设置的数字
		he.setHere_kind_num("好多人");
		he.setHere_content("医学内容");
		he.setHere_evaluate("不错");
		he.setHere_person_sign("李白");
		he.setHere_charge_sign("杜甫");
		he.setHere_filltime("2011-10-21");
		
		
		he.insertHealthEdu();
		HealthEdu he1 = new HealthEdu(getContext());
		he1.selectHealthEdu(1);
		
		assertEquals(he1.get_Id(),123456);
		assertEquals(he1.getHere_time(),"2011-10-20");
		assertEquals(he1.getHere_place(),"兰州");
		assertEquals(he1.getHere_form(), "医术比赛");
		assertEquals(he1.getHere_theme(), "济世救人");
		assertEquals(he1.getHere_organizer(), "兰州大学");
		assertEquals(he1.getHere_sort(), "不清楚");
		assertEquals(he1.getHere_acc_num(),365);
		assertEquals(he1.getHere_kind_num(), "好多人");
		assertEquals(he1.getHere_content(), "医学内容");
		assertEquals(he1.getHere_evaluate(), "不错");
		assertEquals(he1.getHere_person_sign(), "李白");
		assertEquals(he1.getHere_charge_sign(), "杜甫");
		assertEquals(he1.getHere_filltime(),"2011-10-21");
		
		he1.delectHealthEdu(1);
		String where = _ID + "=" + 123456;
		Cursor cursor = getContext().getContentResolver().query(CONTENT_URI_TB25, null, where, null, null);
		assertEquals(0, cursor.getCount());
	    cursor.close();
	}
}
